<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>User</title>
<link rel="stylesheet" type="text/css" href="style.css" media="screen" />
</head>
<body>
<jsp:include page="common/header.jsp"/>
<b><center>User  : </center></b>

<%@page language="java" import="OnlineExam.*, java.util.*, registration.*"%>
<%
	User user = (User)session.getAttribute("USER");
	List<Test> list = user.retrieveTestsTaken ();
%>
<center>Retrieving Test History for <%=user.getEmailId()%></center><br>
<table border = "1" align ="center">
<thead><tr><TH>TestId</TH><TH>CategoryId</TH><TH>Date</TH><TH>MarksScored</TH><TH>MaximumMarks</TH></tr></thead>
 
<%			 
	for(ListIterator iter = list.listIterator(); iter.hasNext();)
	{
		Test test = (Test) iter.next();
%>
	
 		<tr><td> <%= test.getTestId() %></td>
     		<td> <%= test.getCategoryId() %></td>
     		<td> <%= test.getDate()%></td>
<%
	  
      	if (!(test.underEvaluation()))
      	{
%>
     		<td> <%= test.getMarksScored() %></td>
     		<td> <%= test.getMaximumMarks() %></td>
 
     		<td><form>
     		<INPUT type="button" value="View Details" onClick="window.open('http://<%= request.getServerName()%>/OnlineExam/jsp/DisplayAnswerPaper.jsp?testId=<%=test.getTestId()%>','mywindow','width=700,height=800')">
      		</form></td>
<% 
     	}
	 	else
	 	{
%>
			<td> Under Evaluation</td>
			<td> Under Evaluation</td>
<% 
	 	}
%>
</tr>			            
<%	    
    }
%>
</table><br /><br />
<form  action="User.jsp" method="get">
<center><input type="Submit" value="OK"></center>
</form>
<jsp:include page="common/footer.jsp"/>
</body>
</html>
